#pragma once

#include "CPrinterConfig.h"

class CPrintersUI : public WindowImplBase
{
public:
	CPrintersUI(HWND hParent = NULL);
	~CPrintersUI();

	static DString GetDefaultPrinter();

public:

	LPCTSTR GetWindowClassName() const;

	virtual void OnFinalMessage(HWND hWnd);

	virtual void InitWindow();

	//virtual LRESULT ResponseDefaultKeyEvent(WPARAM wParam);

	virtual DString GetSkinFile();

	virtual DString GetSkinFolder();

	virtual CControlUI* CreateControl(LPCTSTR pstrClass);

	virtual LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);

	virtual LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

protected:

	list_dcmprinter_type m_listPrinter;
	CVerticalLayoutUI* m_pList;
	COptionUI* m_pSel;
	CEditUI*   m_pEdtName;
	CEditUI*   m_pEdtDesc;
	CEditUI*   m_pEdtIP;
	CEditUI*   m_pEdtPort;
	CEditUI*   m_pEdtAE;
	CCheckBoxUI* m_pChkDef;
	DString m_defPrinter;
	
	bool SaveDefaultPrinter();

	void RefreshPrinter();
	void DeletePrinter();
	void AddNewPrinter();
	void ModifyPrinter();

	void Notify(TNotifyUI& msg);
	void OnPrepare(TNotifyUI& msg);
	void OnExit(TNotifyUI& msg);
};

